package org.faradel.pharmapp.entities;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.springframework.stereotype.Component;

/**
 * The persistent class for the OrderMed database table.
 * 
 */
@Entity
@Table(name = "orderMed")
@Component
public class OrderMedication implements Serializable
{
    private static final long serialVersionUID = 1L;

    @Id
    @Column(name = "order_id")
    private int orderId;

    @Temporal(TemporalType.DATE)
    @Column(name = "last_modified")
    private Date lastModified;

    @Temporal(TemporalType.DATE)
    @Column(name = "order_close_date")
    private Date orderCloseDate;

    @Column(name = "order_cost")
    private BigDecimal orderCost;

    @Temporal(TemporalType.DATE)
    @Column(name = "order_open_date")
    private Date orderOpenDate;

    @Column(name = "order_status")
    private String orderStatus;

    private int quantity;

    @Column(name = "total_price")
    private BigDecimal totalPrice;

    @Column(name = "unit_price")
    private BigDecimal unitPrice;

    // bi-directional many-to-one association to Medication
    @ManyToOne
    @JoinColumn(name = "medication_id")
    private Medication medication;

    // bi-directional many-to-one association to Supplier
    @ManyToOne
    @JoinColumn(name = "supplier_id")
    private Supplier supplier;

    // bi-directional many-to-one association to PharmaUser
    @ManyToOne
    @JoinColumn(name = "user_last_modified")
    private PharmaUser pharmaUser1;

    // bi-directional many-to-one association to PharmaUser
    @ManyToOne
    @JoinColumn(name = "user_placed")
    private PharmaUser pharmaUser2;

    public int getOrderId()
    {
        return this.orderId;
    }

    public void setOrderId(int orderId)
    {
        this.orderId = orderId;
    }

    public Date getLastModified()
    {
        return this.lastModified;
    }

    public void setLastModified(Date lastModified)
    {
        this.lastModified = lastModified;
    }

    public Date getOrderCloseDate()
    {
        return this.orderCloseDate;
    }

    public void setOrderCloseDate(Date orderCloseDate)
    {
        this.orderCloseDate = orderCloseDate;
    }

    public BigDecimal getOrderCost()
    {
        return this.orderCost;
    }

    public void setOrderCost(BigDecimal orderCost)
    {
        this.orderCost = orderCost;
    }

    public Date getOrderOpenDate()
    {
        return this.orderOpenDate;
    }

    public void setOrderOpenDate(Date orderOpenDate)
    {
        this.orderOpenDate = orderOpenDate;
    }

    public String getOrderStatus()
    {
        return this.orderStatus;
    }

    public void setOrderStatus(String orderStatus)
    {
        this.orderStatus = orderStatus;
    }

    public int getQuantity()
    {
        return this.quantity;
    }

    public void setQuantity(int quantity)
    {
        this.quantity = quantity;
    }

    public BigDecimal getTotalPrice()
    {
        return this.totalPrice;
    }

    public void setTotalPrice(BigDecimal totalPrice)
    {
        this.totalPrice = totalPrice;
    }

    public BigDecimal getUnitPrice()
    {
        return this.unitPrice;
    }

    public void setUnitPrice(BigDecimal unitPrice)
    {
        this.unitPrice = unitPrice;
    }

    public Medication getMedication()
    {
        return this.medication;
    }

    public void setMedication(Medication medication)
    {
        this.medication = medication;
    }

    public Supplier getSupplier()
    {
        return this.supplier;
    }

    public void setSupplier(Supplier supplier)
    {
        this.supplier = supplier;
    }

    public PharmaUser getPharmaUser1()
    {
        return this.pharmaUser1;
    }

    public void setPharmaUser1(PharmaUser pharmaUser1)
    {
        this.pharmaUser1 = pharmaUser1;
    }

    public PharmaUser getPharmaUser2()
    {
        return this.pharmaUser2;
    }

    public void setPharmaUser2(PharmaUser pharmaUser2)
    {
        this.pharmaUser2 = pharmaUser2;
    }

}